﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SpectrEngine.Framework.Collision
{
    public sealed class CollisionMap
    {
        public Color[] Pixels;

        public List<Rectangle> MapBounds;

        public int CurrentMap;

        public int Width
        {
            get { return MapBounds[CurrentMap].Width; }
        }

        public int Height
        {
            get { return MapBounds[CurrentMap].Height; }
        }

        public Vector2 TopLeft
        {
            get
            {
                return new Vector2(
                    MapBounds[CurrentMap].Left,
                    MapBounds[CurrentMap].Top
                    );
            }
        }

        public Color GetPixel(int x, int y)
        {
            return Pixels[MapBounds[CurrentMap].Left + x + (MapBounds[CurrentMap].Top + y) * MapBounds[CurrentMap].Width];
        }

        public CollisionMap()
        {
            Pixels = null;
            MapBounds = new List<Rectangle>();
            CurrentMap = 0;
        }
    }
}
